<?php
$con = mysql_connect("localhost","root","root");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("miniglider", $con);
$dateTime = date("Y-m-d",strtotime("-1 day"));
#$dateTime = '2012-04-14';

mysql_query("INSERT INTO blacklist SELECT max( id ),
  firstlogindata,
  firstlogin,
  jailbreak,
  totalTime,
  dayTotalTime,
  dayPlayTime,
  totalMoney,
  nowMoney,
  dayGetMoney,
  dayIapGold,
  dayUsedMoney,
  IAP1,
  IAP2,
  IAP3,
  IAP4,
  IAP5,
  IAP6,
  buyFigureA1,
  buyFigureA2,
  buyFigureA3,
  buyFigureA4,
  buyFigureA5,
  buyFigureA6,
  upgradeB1Level,
  upgradeB2Level,
  upgradeB3Level,
  upgradeB4Level,
  upgradeB5Level,
  upgradeB6Level,
  upgradeB7Level,
  upgradeB8Level,
  upgradeB9Level,
  upgradeB10Level,
  upgradeB11Level,
  upgradeB12Level,
  upgradeB13Level,
  upgradeB14Level,
  upgradeB15Level,
  upgradeB16Level,
  upgradeB17Level,
  upgradeB18Level,
  upgradeB19Level,
  upgradeB20Level,
  equipNowC1,
  equipNowC2,
  equipNowC3,
  equipNowC4,
  equipNowC5,
  equipBuyC1,
  equipBuyC2,
  equipBuyC3,
  equipBuyC4,
  equipBuyC5,
  equipUsedC1,
  equipUsedC2,
  equipUsedC3,
  equipUsedC4,
  equipUsedC5,
  dayUI1TapCount,
  dayUI2TapCount,
  dayUI3TapCount,
  dayUI4TapCount,
  dayUI5TapCount,
  lastUi,
  dayPlayNowTime,
  dayPlayLongTime,
  dayPlayShortTime,
  dayPlayAvgTime,
  dayPlayLongDis,
  dayPlayShortDis,
  dayPlayAvgDis,
  deviceid,
  gamename,
  createdate,
  date,
  dataTime  FROM  miniglider_query where dayPlayShortTime = 10000000 GROUP BY deviceid");
mysql_query("delete from miniglider_query where dayPlayShortTime = 10000000");

mysql_close($con);
?>